package com.roi.model;

import java.util.Calendar;
import java.util.Date;
import java.io.Serializable;
import java.text.*;

public class Transaction implements Serializable {
	private static final long serialVersionUID = 40245263522740365L;
	private Date timestamp;
	private double amount;
	private String ref;
	private int fromAccount;
	private int toAccount;
	private SimpleDateFormat fmt = new SimpleDateFormat("dd MMM yyyy ");

	public Transaction() {
		this.timestamp = Calendar.getInstance().getTime();
	}

	public Transaction(double amount, String ref, int fromAccount, int toAccount) {
		this.timestamp = Calendar.getInstance().getTime();
		this.amount = amount;
		this.ref = ref;
		this.fromAccount = fromAccount;
		this.toAccount = toAccount;

	}

	public String toString() {
		String result = null;
		result += fmt.format(timestamp) + ref + "            " + amount;

		return result;
	}
}
